package com.eight.feign;

import com.eight.pojo.TbUserCoupon;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@FeignClient("rentcar-customer")
public interface UserFeign {

    /**
     * 查询用户拥有的优惠券的费恩接口
     * @param username 用户名
     * @return 得到的结果
     */
    @GetMapping("/customer/tbUserCoupon/selectAllUser/{username}")
    List<TbUserCoupon> selectAllUser(@PathVariable String username);

    /**
     * 插入一条用户优惠券信息
     * @param tbUserCoupon 用户优惠券信息
     * @return 插入的结果
     */
    @PostMapping("/customer/api/tbUserCoupon/inserUserCon")
    int inserUserCon(@RequestBody TbUserCoupon tbUserCoupon);

}
